QuaternaryDictionary.AddValueIndex(string, Func) method¶
Defined in
Type: QuaternaryDictionaryReactiveList.Reactive.Collections
Assembly: ReactiveList.Reactive.dll
Applies to
net11.0, net10.0, net47, net471, net472, net48, net481
public void AddValueIndex<TIndexKey>(string indexName, Func<TValue, TIndexKey> keySelector) where TIndexKey : notnull
View source (opens in a new tab)
Summary: Adds a secondary index for values using the specified key selector function.
Type parameters
| Name | Description |
|---|---|
TIndexKey | The type of the index key. |
Parameters
| Name | Type | Description |
|---|---|---|
indexName | string (opens in a new tab) | The unique name of the index to add. |
keySelector | Func | A function that extracts the index key from a value. |
Remarks
The index is built and registered while every shard is write-locked, so no entry is missed. An existing
index with the same name is replaced. If keySelector throws while the index is built, the index is not registered.
If it throws later, during a mutation, the mutation is still committed and announced, the index does not hold that value,
and the exception propagates to the caller after the change is complete.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException (opens in a new tab) | indexName or keySelector is null. |